#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>

using namespace std;

void test()
{
	string s1("hello world");
	string::reverse_iterator rit = s1.rbegin();

	while (rit != s1.rend())
	{
		cout << *rit << " ";
		++rit;
	}
}
int main()
{
	test();
	return 0;
}